#include "type.h"
#pragma once
#ifndef TYPE_ENUM_H
#define TYPE_ENUM_H
typedef enum binlog_type {
	/**
	Every time you update this enum (when you add a type), you have to
	fix Format_description_event::Format_description_event().
	*/
	UNKNOWN_EVENT = 0,
	START_EVENT_V3 = 1,
	QUERY_EVENT = 2,
	STOP_EVENT = 3,
	ROTATE_EVENT = 4,
	INTVAR_EVENT = 5,
	LOAD_EVENT = 6,
	SLAVE_EVENT = 7,
	CREATE_FILE_EVENT = 8,
	APPEND_BLOCK_EVENT = 9,
	EXEC_LOAD_EVENT = 10,
	DELETE_FILE_EVENT = 11,
	/**
	NEW_LOAD_EVENT is like LOAD_EVENT except that it has a longer
	sql_ex, allowing multibyte TERMINATED BY etc; both types share the
	same class (Load_event)
	*/
	NEW_LOAD_EVENT = 12,
	RAND_EVENT = 13,
	USER_VAR_EVENT = 14,
	FORMAT_DESCRIPTION_EVENT = 15,
	XID_EVENT = 16,
	BEGIN_LOAD_QUERY_EVENT = 17,
	EXECUTE_LOAD_QUERY_EVENT = 18,
	TABLE_MAP_EVENT = 19,
	/**
	The PRE_GA event numbers were used for 5.1.0 to 5.1.15 and are
	therefore obsolete.
	*/
	PRE_GA_WRITE_ROWS_EVENT = 20,
	PRE_GA_UPDATE_ROWS_EVENT = 21,
	PRE_GA_DELETE_ROWS_EVENT = 22,
	/**
	The V1 event numbers are used from 5.1.16 until mysql-trunk-xx
	*/
	WRITE_ROWS_EVENT_V1 = 23,
	UPDATE_ROWS_EVENT_V1 = 24,
	DELETE_ROWS_EVENT_V1 = 25,
	/**
	Something out of the ordinary happened on the master
	*/
	INCIDENT_EVENT = 26,
	/**
	Heartbeat event to be send by master at its idle time
	to ensure master's online status to slave
	*/
	HEARTBEAT_LOG_EVENT = 27,
	/**
	In some situations, it is necessary to send over ignorable
	data to the slave: data that a slave can handle in case there
	is code for handling it, but which can be ignored if it is not
	recognized.
	*/
	IGNORABLE_LOG_EVENT = 28,
	ROWS_QUERY_LOG_EVENT = 29,
	/** Version 2 of the Row events */
	WRITE_ROWS_EVENT = 30,
	UPDATE_ROWS_EVENT = 31,
	DELETE_ROWS_EVENT = 32,
	GTID_LOG_EVENT = 33,
	ANONYMOUS_GTID_LOG_EVENT = 34,
	PREVIOUS_GTIDS_LOG_EVENT = 35,
	TRANSACTION_CONTEXT_EVENT = 36,
	VIEW_CHANGE_EVENT = 37,
	/* Prepared XA transaction terminal event similar to Xid */
	XA_PREPARE_LOG_EVENT = 38,
	/**
	Add new events here - right above this comment!
	Existing events (except ENUM_END_EVENT) should never change their numbers
	*/
	ENUM_END_EVENT /* end marker */
}TL_LOGTYPE;
static CPTR type_chang_to_name(TL_LOGTYPE logtype) {
	switch (logtype)
	{
	case UNKNOWN_EVENT:
		return "UNKNOWN_EVENT";
		break;
	case START_EVENT_V3:
		return "START_EVENT_V3";
		break;
	case QUERY_EVENT:
		return "QUERY_EVENT";
		break;
	case STOP_EVENT:
		return "STOP_EVENT";
		break;
	case ROTATE_EVENT:
		return "ROTATE_EVENT";
		break;
	case INTVAR_EVENT:
		return "INTVAR_EVENT";
		break;
	case LOAD_EVENT:
		return "LOAD_EVENT";
		break;
	case SLAVE_EVENT:
		return "SLAVE_EVENT";
		break;
	case CREATE_FILE_EVENT:
		return "CREATE_FILE_EVENT";
		break;
	case APPEND_BLOCK_EVENT:
		return "APPEND_BLOCK_EVENT";
		break;
	case EXEC_LOAD_EVENT:
		return "EXEC_LOAD_EVENT";
		break;
	case DELETE_FILE_EVENT:
		return "DELETE_FILE_EVENT";
		break;
	case NEW_LOAD_EVENT:
		return "NEW_LOAD_EVENT";
		break;
	case RAND_EVENT:
		return "RAND_EVENT";
		break;
	case USER_VAR_EVENT:
		return "USER_VAR_EVENT";
		break;
	case FORMAT_DESCRIPTION_EVENT:
		return "FORMAT_DESCRIPTION_EVENT";
		break;
	case XID_EVENT:
		return "XID_EVENT";
		break;
	case BEGIN_LOAD_QUERY_EVENT:
		return "BEGIN_LOAD_QUERY_EVENT";
		break;
	case EXECUTE_LOAD_QUERY_EVENT:
		return "EXECUTE_LOAD_QUERY_EVENT";
		break;
	case TABLE_MAP_EVENT:
		return "TABLE_MAP_EVENT";
		break;
	case PRE_GA_WRITE_ROWS_EVENT:
		return "PRE_GA_WRITE_ROWS_EVENT";
		break;
	case PRE_GA_UPDATE_ROWS_EVENT:
		return "PRE_GA_UPDATE_ROWS_EVENT";
		break;
	case PRE_GA_DELETE_ROWS_EVENT:
		return "PRE_GA_DELETE_ROWS_EVENT";
		break;
	case WRITE_ROWS_EVENT:
		return "WRITE_ROWS_EVENT";
		break;
	case UPDATE_ROWS_EVENT:
		return "UPDATE_ROWS_EVENT";
		break;
	case DELETE_ROWS_EVENT:
		return "DELETE_ROWS_EVENT";
		break;
	case INCIDENT_EVENT:
		return "INCIDENT_EVENT";
		break;
	case HEARTBEAT_LOG_EVENT:
		return "HEARTBEAT_LOG_EVENT";
		break;
	case IGNORABLE_LOG_EVENT:
		return "IGNORABLE_LOG_EVENT";
		break;
	case ROWS_QUERY_LOG_EVENT:
		return "ROWS_QUERY_LOG_EVENT";
		break;
	//case WRITE_ROWS_EVENT_30:
	//	return "WRITE_ROWS_EVENT_30";
	//	break;
	//case UPDATE_ROWS_EVENT_31:
	//	return "UPDATE_ROWS_EVENT_31";
	//	break;
	//case DELETE_ROWS_EVENT_32:
	//	return "DELETE_ROWS_EVENT_32";
	//	break;
	case GTID_LOG_EVENT:
		return "GTID_LOG_EVENT";
		break;
	case ANONYMOUS_GTID_LOG_EVENT:
		return "ANONYMOUS_GTID_LOG_EVENT";
		break;
	case PREVIOUS_GTIDS_LOG_EVENT:
		return "PREVIOUS_GTIDS_LOG_EVENT";
		break;
	case ENUM_END_EVENT:
		return "ENUM_END_EVENT";
		break;
	default:
		break;
	}
}
#endif // !TYPE_ENUM_H
